<template>
  <el-table :data="logData" border style="width: 100%">
    <el-table-column prop="username" label="登录账号" />
    <el-table-column prop="lastLogin.ip" label="上次登录IP" />
    <el-table-column prop=" lastLogin.loginTime" label="上次登录时间" sortable />
    <el-table-column prop="nowLogin.ip" label="本次登录IP" />
    <el-table-column prop="nowLogin.loginTime" label="本次登录时间" />
  </el-table>
</template>

<script setup>
//引入接口
import * as api from "@/api/loginlog.js";
import { onBeforeMount, ref } from "vue";

let logData = ref([]);

onBeforeMount( async () => {

  try{
    //发起请求
    let res = await api.getLogin()
    // console.log(res)
    logData.value=res.data.data
  }catch(e){
    console.log(e)
  }
 
  });

</script>
<script>
export default{
  meta:{
    title: 'glsy', 
    name: '管理首页',
    routeName:'welcome',
    icon:'icon-shouye1'
  }
}
</script>
